home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / listings / ptv2n5 / direct.bas < prev    next >
BASIC Source File  |  1991-09-09  |  1KB  |  43 lines

  1. Sub Command1_Click ()        ' "PRINT DIRECTLY" BUTTON
  2.  
  3.   ' Uses Visual BASIC commands to plot circles and
  4.   ' lines directly on the printer.
  5.  
  6.   Screen.MousePointer = 11   ' HOURGLASS CURSOR
  7.  
  8.   printer.ScaleMode = 5      ' SCALE IN INCHES
  9.   
  10.   Picture1.Cls
  11.   Picture1.Print "Plotting on printer..."
  12.   
  13.   printer.DrawWidth = 3      ' DRAW CIRCLES
  14.   printer.Circle (2, 2), 1.5
  15.   printer.DrawWidth = 1
  16.   printer.Circle (2, 2), 1.45
  17.  
  18.   printer.DrawWidth = 1      ' DRAW LISSAJOUS FIGURE
  19.   Pi# = 3.1415926537
  20.   x = 2
  21.   y = 2 + 1
  22.   printer.PSet (x, y)
  23.   For t# = 0 To Pi# * 32.1 Step Pi# / 64
  24.     x = 2 + Sin(t#)
  25.     y = 2 + Cos(t# * 1.0625)
  26.     printer.Line -(x, y)
  27.     s% = DoEvents()
  28.   Next t#
  29.  
  30.   m$ = "PC Techniques"       ' PRINT LABEL
  31.   printer.CurrentY = 3.05
  32.   printer.CurrentX = 2 - printer.TextWidth(m$) / 2
  33.   printer.Print m$
  34.  
  35.   Picture1.Print "Spooling output..."
  36.  
  37.   printer.EndDoc             ' CLOSE PRINTER
  38.   Picture1.Print "Finished"
  39.   
  40.   Screen.MousePointer = 0    ' NORMAL CURSOR
  41.  
  42. End Sub
  43.